var C = Object.defineProperty, x = Object.defineProperties;
var P = Object.getOwnPropertyDescriptors;
var l = Object.getOwnPropertySymbols;
var N = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
var c = (t, e, n) => e in t ? C(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, s = (t, e) => {
  for (var n in e || (e = {}))
    N.call(e, n) && c(t, n, e[n]);
  if (l)
    for (var n of l(e))
      w.call(e, n) && c(t, n, e[n]);
  return t;
}, g = (t, e) => x(t, P(e));
import { getCurrentInstance as A, ref as B, computed as o, watch as V } from "vue";
import { c as j } from "../component-87e22bdd.mjs";
import { c as M } from "../props-c0e5b20d.mjs";
import { p as m } from "../pxCheck-fb1b9a66.mjs";
/*!
* Vin UI 移动端 Vue3 组件库 v0.2.9 Fri Jun 02 2023 21:01:02 GMT+0800 (中国标准时间)
* (c) 2023 @vingogo.
* Released under the MIT License.
*/
function k(t) {
  const e = A();
  e && Object.assign(e.proxy, t);
}
const z = g(s({}, M), {
  list: {
    type: Array,
    default: () => []
  },
  width: {
    type: [Number, String],
    default: "100%"
  },
  height: {
    type: [Number, String],
    default: 150
  },
  direction: {
    type: String,
    default: "horizontal"
    // horizontal and vertical
  },
  paginationVisible: {
    type: Boolean,
    default: !1
  },
  paginationColor: {
    type: String,
    default: "rgba(0, 0, 0, 0.3)"
  },
  paginationActiveColor: {
    type: String,
    default: "#000"
  },
  loop: {
    type: Boolean,
    default: !0
  },
  duration: {
    type: [Number, String],
    default: 500
  },
  autoPlay: {
    type: [Number, String],
    default: 0
  },
  initPage: {
    type: [Number, String],
    default: 0
  },
  touchable: {
    type: Boolean,
    default: !0
  }
}), { create: E, useVinContext: I } = j("swiper"), L = E({
  props: z,
  emits: ["change"],
  setup(t, { emit: e }) {
    const { getMainClass: n, getMainStyle: f } = I(t), i = B(0), p = o(n), d = o(() => f({
      width: m(t.width),
      height: m(t.height)
    })), y = o(() => t.list.length), r = o(() => t.autoPlay > 0 && y.value > 1), h = o(() => r.value ? Number(t.autoPlay) : 0), b = o(() => t.direction === "vertical");
    V(
      () => t.initPage,
      (a) => {
        i.value = Number(a);
      }
    );
    const S = (a) => {
      const v = a.detail.current;
      e("change", v);
    }, u = (a) => {
      i.value += a;
    };
    return k({
      prev: () => {
        u(-1);
      },
      next: () => {
        u(1);
      },
      to: (a) => {
        i.value = a;
      }
    }), {
      mainClass: p,
      mainStyle: d,
      isAutoPlay: r,
      interval: h,
      isVertical: b,
      current: i,
      onChange: S
    };
  }
});
export {
  L as default
};
